from sklearn.datasets import make_hastie_10_2
from sklearn.ensemble import GradientBoostingClassifier


if __name__ == '__main__':
    X, y = make_hastie_10_2(random_state=0)
    X_train, X_test = X[:2000], X[2000:]
    y_train, y_test = y[:2000], y[2000:]

    clf = GradientBoostingClassifier(n_estimators=100, learning_rate=1.0,
                                     max_depth=1, random_state=0).fit(X_train, y_train)
    print(clf.score(X_test, y_test))

# https://www.cnblogs.com/pinard/p/6143927.html
